/*
 * @Author: wuzhouhai wzh200x@126.com
 * @Date: 2024-07-09 17:41:42
 * @LastEditors: wuzhouhai wzh200x@126.com
 * @LastEditTime: 2024-07-11 15:27:31
 * @FilePath: \dwys_web\extensions\phoenix-plugin-client\assets\core\utils\Utils.ts
 * @Description: 
 */
import md5 from 'md5';

export class Utils {
    public static Md5Encode(input: string): string {
        return md5(input);
    }

    public static IsValidIPv4(ip: string): boolean {
        const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
        return ipRegex.test(ip);
    }
}